const Router = require('koa-router');
const tool = require("../../tools/tool");
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");


// 查看是否有预收商品
router.post('/bill/getYsList', async ctx => {
    try {
        let tenantId = ctx.user.tenantId;
        let buId = ctx.request.body.buId ? ctx.request.body.buId : 0;
        let list = db.query(`exec get_ys_goods @tenantId=${tenantId},@buId=${buId}`, { type: QueryTypes.SELECT });
        return ctx.suc('', list);
    } catch (e) {
        return ctx.err(e);
    }
})
module.exports = router;